{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>编辑员工</h5>
                </div>
                <div class="ibox-content layui-form">
                    <div class="layui-row layui-col-space10 layui-form-item ">

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8 form-group">
                            <label class="layui-form-label">角色：</label>
                            <div class="layui-input-block">
                                <select name="cm_member_type" lay-filter="role1">
                                    <option value="2" {$member.cm_member_type == 2 ? 'selected' : ''}>总裁判</option>
                                    <option value="3" {$member.cm_member_type == 3 ? 'selected' : ''}>终点裁判</option>
                                    <option value="4" {$member.cm_member_type == 4 ? 'selected' : ''}>编排长</option>
                                    <option value="5" {$member.cm_member_type == 5 ? 'selected' : ''}>仲裁主任</option>
                                    <option value="6" {$member.cm_member_type == 6 ? 'selected' : ''}>仲裁秘书</option>
                                    <option value="7" {$member.cm_member_type == 7 ? 'selected' : ''}>竞赛检录</option>
                                </select>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">用户：</label>
                            <div class="layui-input-block">
                                <select name="cm_match_user_id" xm-select="select2" lay-verify="required" xm-select-radio=""  xm-select-search="" xm-select-search-type="dl">
                                    {foreach name='user' item='vo'}
                                    <option value="{$vo.user_id}" {$vo.user_id == $member.cm_match_user_id ? 'selected' : ''}>{$vo.user_username}--{$vo.user_phone}--{$vo.user_create_id}</option>
                                    {/foreach}
                                </select>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">登录账号：</label>
                            <div class="layui-input-block">
                                <input type="text" name="cm_login_ID" lay-verify="required" placeholder="登录账号" class="layui-input" value="{$member.cm_login_ID}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">登录密码：</label>
                            <div class="layui-input-block">
                                <input type="text" name="cm_login_pwd" placeholder="登录密码" class="layui-input">
                            </div>
                        </div>

                        <input type="hidden" name="cm_id" value="{$cm_id}">

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit="" lay-filter="component-form-element">保存
                                </button>
                                <button class="layui-btn layui-btn-primary" onclick="history.go(-1)">关闭</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    layui.use(['form','upload','layedit','laydate'], function() {
        var form = layui.form;
        form.on('submit(component-form-element)', function (data) {
            $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            $.ajax({
                url:"{:url('workerEdit')}",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                    if (res.code == 200) {
                        wk.success(res.msg,"{:url('Worker/index')}")
                    } else {
                        wk.error(res.msg,'','$(".layui-btn").removeClass(\'layui-disabled\').removeAttr(\'disabled\');');
                    }
                }
            })
        });
    });
</script>

</body>
</html>
